import { reqSubmitOrder } from '../../api';
const actions = {
  async getSubmitOrder({commit},orderInfo){
    let result = await reqSubmitOrder(orderInfo.tradeNo,orderInfo)
    console.log('reqSubmitOrder',result)
    if(result.code === 200){
      commit('GETSUBMITORDER',result.data)
      return 'ok'
    }else{
      return Promise.reject(new Error(result.message))
    }
  }
}
const mutations = {
  GETSUBMITORDER(state,data){
    state.orderId = data
  }
}

const state = {
  orderId:''
}

const getters = {}

export default {
  namespaced: true,
  actions,
  mutations,
  state,
  getters
}